//
//  MainViewController.m
//  SDSY
//
//  Created by 蓝布鲁 on 2017/3/17.
//  Copyright © 2017年 蓝布鲁. All rights reserved.
//

#import "MainViewController.h"
#import "MyActivityViewController.h"
#import "MyOrderedViewController.h"
#import "SettingsViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController

#pragma mark - 初始化方法
-(instancetype)init{
    if (self==[super init]) {
        // 设置TabBar的字控制器
        [self setupViewControllers];
    }
    return self;
}

#pragma mark - 系统回调方法
- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 修复黑影
    self.view.backgroundColor = UIColor.whiteColor;

}

#pragma mark - 自定义方法
/**
 * @brief 设置TabBar的字控制器
 */
- (void)setupViewControllers {
    // 1.设置我的活动控制器&导航控制器
    MyActivityViewController *myActivityViewController = [[MyActivityViewController alloc] init];
    UINavigationController *myActivityNavi = [[UINavigationController alloc] initWithRootViewController:myActivityViewController];
    [self addChildViewController:myActivityNavi];
    
    // 2.设置我的预约控制器&导航控制器
    MyOrderedViewController *myOrderedViewController = [[MyOrderedViewController alloc] init];
    UINavigationController *myOrderedNavi = [[UINavigationController alloc] initWithRootViewController:myOrderedViewController];
    [self addChildViewController:myOrderedNavi];
    
    // 3.设置资讯控制器&导航控制器
    SettingsViewController *settingsViewController = [[SettingsViewController alloc] init];
    UINavigationController *settingsNavi = [[UINavigationController alloc] initWithRootViewController:settingsViewController];
    [self addChildViewController:settingsNavi];
}

@end
